package com.rice.cli;

import com.rice.cli.command.GeneratorCommand;
import picocli.CommandLine;

/**
 * 命令执行器
 * @author ricesjon
 */
@CommandLine.Command(name = "rice", mixinStandardHelpOptions = true)
public class CommandExecutor implements Runnable {

    private final CommandLine commandLine;
    {
        commandLine = new CommandLine(this);
        commandLine.addSubcommand(new GeneratorCommand());
    }
    @Override
    public void run() {
        System.out.println("请输入具体命令，或者输入--help查看帮助文档");
    }

    /**
     * 执行命令
     */
    public void doExecute(String[] args) {
        commandLine.execute(args);
    }
}
